package com.example.campuslink.commen.http

import okhttp3.ResponseBody
import retrofit2.Response
import retrofit2.http.Body
import retrofit2.http.GET
import retrofit2.http.Header
import retrofit2.http.Headers
import retrofit2.http.POST
import retrofit2.http.Streaming
import retrofit2.http.Url


interface ApiService {
    @POST("chat/completions")
    @Headers(
        "Authorization: Bearer sk-lazzgmvrdwncgfpihlanzskuhzuhieyvmjrxucfndyqfmuwu",
        "Content-Type: application/json"
    )
    suspend fun createCompletion(
        @Body body: CompletionRequest
    ): CompletionResponse


    @Headers(
        "Authorization: Bearer sk-lazzgmvrdwncgfpihlanzskuhzuhieyvmjrxucfndyqfmuwu",
        "Content-Type: application/json"
    )
    @POST("images/generations")
    suspend fun generateImage(
        @Body request: ImageRequest
    ): Response<ImageResponse>

    @Streaming
    @GET
    suspend fun downloadImage(@Url imageUrl: String): Response<ResponseBody>
}